<!DOCTYPE html>
<html>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<head>
<script src='/__ax_init.js' type='text/javascript'></script>
<script src='/__ax.js' type='text/javascript'></script>
<link rel="stylesheet" href="/static/css/style.css">

</head>

<body>

<h1>Ax toolkit</h1>

<br>
<button onclick="sendRequest()">Send request</button>
<br>
<span id="value"></span>

<script type="text/javascript">
  ax.init(function () {
    ax.on('answer', function (data) {
      document.getElementById("value").innerHTML =
                              parseInt(data.value) + ' requests so far';
    });
  });
  function sendRequest() {
    ax.send('request',
              { path: window.location.pathname });
  }
</script>

</body>
</html>
